/*
 * @(#)TextField.java        0.1 09/04/29
 * @version 	0.1 29 Apr 2009
 * @author 	Do Van Khang
 * 
 * Thua ke tu JTextField, xu ly cac su kien khi nguoi dung thay doi noi dung text
 */


package GUI;

import javax.swing.*;
import javax.swing.event.*;

import javax.swing.text.*;


public class TextField extends JTextField implements DocumentListener {
	public TextField() {
		super();
		Document document = this.getDocument();
		document.addDocumentListener(this);
	}
	
	public TextField(String s, int i) {
		super(s, i);
		Document document = this.getDocument();
		document.addDocumentListener(this);
	}
	
	/*
	 * Su kien thay doi ni dung textField
	 * @see javax.swing.event.DocumentListener#changedUpdate(javax.swing.event.DocumentEvent)
	 */
	public void changedUpdate(DocumentEvent e) {
		MainFrame.isSaved = false;
		MainFrame.isLogged = false;
	}
	
	public void insertUpdate(DocumentEvent e) {
	}
	
	public void removeUpdate(DocumentEvent e) {
	}
}
